
int bitsInCommon( uint32_t first, uint32_t second ) {
  
  int toRet = 0;
  int idx = 31;
  while ( idx >= 0 ) {
    if ( (first & (1 << idx)) == (second & (1 << idx)) ) {
      toRet += 1;
      idx -= 1;
    }
    else {
      return toRet;
    }
  }
  return toRet;
}


